﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.HomeServer.SDK.Interop.v1;
using Umbrella.Whs.Contracts;

namespace Umbrella.Whs.Service
{
    partial class SingletonService
    {
        public IEnumerable<UserInfo> GetAllUsers()
        {
            try
            {
                var users = _whsInfo.GetUsersInfo();

                var r = new List<UserInfo>();

                foreach (IUserInfo u in users)
                    r.Add(u.ToContract());

                return r.AsReadOnly();
            }
            catch (Exception x)
            {
                _log.Error("GetAllUsers() failed", x);

                throw;
            }
        }

        public void SetAllUsersAccess(IEnumerable<UserInfo> users, bool revokeUnmentionedUsers)
        {
            throw new NotImplementedException();
        }
    }
}
